package com.mt.api.modules.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
* 
* @description /
* @author plover
* @date 2020-07-06
**/
@Data
@TableName("es_boss")
public class AppBoss implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "小程序openid")
    private String openId;

    @ApiModelProperty(value = "公众号openid")
    private String mpOpenId;

    private String unionId;

    @ApiModelProperty(value = "会话密钥")
    private String sessionKey;

    @ApiModelProperty(value = "avatarurl")
    private String avatarUrl;

    @ApiModelProperty(value = "nickname")
    private String nickName;

    @ApiModelProperty(value = "账号")
    private String account;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "md5密码盐")
    private String salt;

    @ApiModelProperty(value = "名字")
    private String name;

    @ApiModelProperty(value = "电话")
    private String phone;

    @ApiModelProperty(value = "用户类型 （1商户 2客户）")
    private Integer userType;

    @ApiModelProperty(value = "用户等级")
    private Integer userLevel;

    @ApiModelProperty(value = "余额")
    private BigDecimal money;

    @ApiModelProperty(value = "总金额")
    private BigDecimal totalMoney;

    @ApiModelProperty(value = "注册日期")
    private Date regDate;

    @ApiModelProperty(value = "有效日期")
    private Date expiryDate;

    @ApiModelProperty(value = "最后登录时间")
    private Date lastLoginTime;

    @ApiModelProperty(value = "用户状态（0失效 1正常 9过期）")
    private Integer status;

    @ApiModelProperty(value = "账号类型 1-主账号 2-子账号")
    private Integer accountType;

    @ApiModelProperty(value = "子账号数量")
    private Integer childAccountCount;

    @ApiModelProperty(value = "是否删除 0-否 1-是")
    private Integer deleted;

    @TableField(fill = FieldFill.INSERT)
    private Integer createId;

    @TableField(fill = FieldFill.INSERT)
    private String creator;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateId;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updater;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    public void copy(AppBoss source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}